#include <iostream>
#include <gtest/gtest.h>
#include "src/TGLine.h"


TEST(IntersectionTest, NotIntersection) {
    TGLine l1(0, 0, 0, 1), l2(1, 0, 1, 1);
    TGPoint p;
    bool flag = intersection(l1, l2, p);
    EXPECT_EQ(flag, false);
}

TEST(IntersectionTest, Intersection) {
    TGLine l1(8,1,7,8), l2(10,8,2,2);
    TGPoint p;
    bool flag = intersection(l1, l2, p);
    EXPECT_EQ(flag, true);
    TGPoint ep(7.29032, 5.96774);
    EXPECT_EQ(p, ep);
}

int main(int argc, char* argv[]) {

    ::testing::InitGoogleTest(&argc, argv);

    return RUN_ALL_TESTS();
}
